import React from 'react';
import { Icon } from 'antd';
import styles from './index.less';
import IconFont from '@/assets/iconfont';

const Index: React.FC<any> = (props) => {
  const { links } = props;

  return (
    <div className={styles.linkGroup}>
      {links.map((link: any, idx: any) => (
        <a style={{ textAlign: 'center' }} onClick={link.onClick} key={idx}>
          <div>{link.icon ? <Icon type={link.icon} style={{ fontSize: 25 }} /> :
            link.iconFont ? <IconFont type={link.iconFont} style={{ fontSize: 25 }} /> :
              <IconFont type='iconkuaijiefangshi' style={{ fontSize: 25 }} />}</div>
          <div>{link.name}</div>
        </a>
      ))}
    </div>
  );
};

export default Index;
